﻿<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>WebNoteEditor</title>
<link rel="STYLESHEET" type="text/css" id="SkinStyleSheet">
<style type="text/css">
#InputWidth,#InputHeight{
	width:30px;text-align:center;
}
</style>
<script language="javascript" type="text/javascript" src="../script/windialog.js"></script>
<script language="javascript" type="text/javascript" src="../script/ie2w3c-min.js"></script>
<script language="javascript" type="text/javascript">
var FlashPlayer_FileType=EditorWindow.FlashPlayer_FileType;
var DefaultWidth=100;
var DefaultHeight=100;

window.onload=function()
{
	renderWindowAsIE(window);
	EditorWindow.XEditor.focus();
	if (XEditor.selection.type=="Control")
	{
		if (XEditor.objselected.tagName=="OBJECT")
		{
			document.getElementById("InputWidth").value=XEditor.objselected.clientWidth;
			document.getElementById("InputHeight").value=XEditor.objselected.clientHeight;
			document.getElementById("Movie").value=EditorWindow.getParamValueByName(XEditor.objselected.innerHTML,"src");
			EditorWindow._FormfocusRadio("Wmode",EditorWindow.getParamValueByName(XEditor.objselected.innerHTML,"wmode"),document);
			
		}
		else
		{
			window.close();
		}
	}

	
	document.getElementById("sel_file").onchange=sel_file_onchange;
	AutoResizeDialogWindow();
}



function __btnOk_onclick()
{
	if (XEditor.selection.type=="Control")
	{
		if (XEditor.objselected.tagName=="OBJECT")
		{
			XEditor.objselected.outerHTML=buildFlashHTML();
		}
	}
	else
	{
		if (document.getElementById("Movie").value.trim()!="")
		{
			EditorWindow.pasteHTML(buildFlashHTML());
		}

	}
	EditorWindow.__showGuide();
	window.close();
}


function __btnCancel_onclick()
{
	window.close();
}

function sel_file_onchange()
{
	var ExName,AllowEx;
	if (document.getElementById("sel_file").value!="")
	{
		ExName=EditorWindow.getFileExt(document.getElementById("sel_file").value);

		AllowEx=FlashPlayer_FileType;
		
		document.getElementById("Movie").value=document.getElementById("sel_file").value;
		
		if (FlashPlayer_FileType.isInArray(ExName))
		{
			if (!document.getElementById("InputWidth").value.isNumber())
				document.getElementById("InputWidth").value=DefaultWidth;
			if (!document.getElementById("InputHeight").value.isNumber())
				document.getElementById("InputHeight").value=DefaultHeight;		
			return;
		}
		
		document.getElementById("Movie").value="";
		alert(EditorWindow.tipsmsgReplace(EditorWindow.lang_tips_mediafileformaterror,"{0}|{1}",ExName+"|"+AllowEx));

	}

}

function buildFlashHTML()
{
	var FlashHtml="",strWmode;
	strWmode=EditorWindow._FormgetRadioValue("Wmode",document);
	if (strWmode=="")
		strWmode="Transparent";
	FlashHtml=FlashHtml+"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' height='"+document.getElementById("InputHeight").value+"px' width='"+document.getElementById("InputWidth").value+"px'><param name=quality value=high>";
	FlashHtml=FlashHtml+"<param name='movie' value='" +document.getElementById("Movie").value+ "'><param name='src' value='" +document.getElementById("Movie").value+ "'><param name='WMode' value='"+strWmode+"'></object>";
	return FlashHtml;
}

</script>
</head>

<body class="dialog">
<script language="javascript" type="text/javascript">dialogTitle("lang_attribute_flash")</script>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%">
    	<div style="position:relative">
    		<script language="javascript" type="text/javascript">dialogPrintlang("lang_url")</script><input type="text" id="Movie" class="dialogInput" style="width:380px;height:20px;margin-bottom:-1px;z-index: 1;position: relative">
    		<div style="z-index: 0;position: relative;top:-21px;left:388px"><input id="sel_file" type="file" class="SysBTN5" size="0"></div>
    	</div>
    </td>   
  </tr>
  <tr>
    <td width="100%">
        <script language="javascript" type="text/javascript">dialogPrintlang("lang_width")</script><input type="text" id="InputWidth" size="7" class="dialogInput" datatype="number">px
        &nbsp; &nbsp; 
        <script language="javascript" type="text/javascript">dialogPrintlang("lang_height")</script><input type="text" id="InputHeight" size="7" class="dialogInput" datatype="number">px
		&nbsp; &nbsp; &nbsp; &nbsp; 
		<script language="javascript" type="text/javascript">dialogPrintlang("lang_background")</script>
        <input type="radio" value="Transparent" checked name="Wmode"><script language="javascript" type="text/javascript">dialogPrintlang("lang_background_transparent")</script>
        &nbsp;  
        <input type="radio" value="Window" name="Wmode"><script language="javascript" type="text/javascript">dialogPrintlang("lang_default")</script> 
    </td>
  </tr>
  <tr>
    <td width="100%" class="hr" align="right">
    	<script language="javascript" type="text/javascript">
    		PrintButtons2();
    	</script>
  	</td>
  </tr>
</table>

</body>

</html>
